<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <head>
    </head>
    <body>
        <ui:composition template="/templates/default.xhtml">
		 	<ui:define name="title">OpenHDS - Assign New Roles</ui:define>
		
			<ui:param name="crud" value="#{roleCrud}" />
			
			<ui:param name="showListing" value="false" />
			
			<ui:param name="hideTabBar" value="true" />

            <ui:define name="display">
            	<h2>#{msg.roleFurtherAction}</h2>
            	<div>
					#{msg.roleFurtherActionMessage}
				</div>
				<br />
				<h:messages globalOnly="true" />
				<h:form>
					<h:dataTable value="#{roleCrud.usersAndRoles}" var="uar" cellspacing="20">
						<h:column>
							<f:facet name="header">#{msg.roleUser}</f:facet>
							<h:panelGroup>
								<strong>#{user.userName</strong>: #{uar.user.username}
								<br />
								<strong>#{msg.roleFullName}</strong>: #{uar.user.fullName} 
							</h:panelGroup>
						</h:column>
						<h:column>
							<f:facet name="header">#{msg.roleName}</f:facet>
							<h:selectOneListbox value="#{uar.role}" size="1">
								<f:selectItems value="#{roleCrud.allRolesExceptSelected}" />
							</h:selectOneListbox>
						</h:column>
					</h:dataTable>
					
					<h:commandButton value="#{msg.roleUpdate}" action="#{roleCrud.updateUserRoles}" />
					<h:outputText value=" " />
					<h:commandButton value="#{msg.lblCancel}" action="#{roleCrud.cancelUserAssignment}" />
				</h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>